package net.wanho.entity;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;

/**
 * Author：汤小洋
 * Date：2025-10-24 10:22
 * Description：<描述>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
@Document(indexName = "students") // 标记实体类为文档对象，并指定索引名称
public class Student implements Serializable {

    @Id // 标记为文档id
    @Field(type = FieldType.Keyword)
    private Integer id;

    @Field(type = FieldType.Text)
    private String name;

    @Field(type = FieldType.Integer)
    private Integer age;

    @Field(type = FieldType.Text)
    private String sex;

    @Field(type = FieldType.Text)
    private String school;
}
